#ifndef DETECTIONWINDOWINFO_H
#define DETECTIONWINDOWINFO_H
#include <QString>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QJsonObject>
#include "subimageinfo.h"

/*typedef struct _tagSeatFace{
    QString strFace;
    QString strCamera;
}SEATFACE;*/

class DetectionWindowInfo
{
public:
    DetectionWindowInfo();

private:
    int                     m_nColumn;
    int                     m_nRow;
    int                     m_nTotal;

    QVector<SubImageInfo*>       m_vecSeatFaces;

public:
    DetectionWindowInfo&        operator=(DetectionWindowInfo& a);

public:
    QVector<SubImageInfo*>&      GetSeatFaces(){
        return m_vecSeatFaces;
    }

    void                    ResizeSeatFaces(int nCount);

    void                    ParseSeatFace(QXmlStreamReader &reader);

    void                    SetSeatFaceContent(int index,QString strFace,QString strCamera);

    void                    RemoveSeatFace(int index = -1);

    void                    AppendSeatFace(SubImageInfo* pSeatFace);

public:
    int         GetImageRow(){return m_nRow;}
    int         GetImageCol(){return m_nColumn;}
    int         GetImageTotal(){return m_nTotal;}

    void        SetImageRow(int value){m_nRow = value;}
    void        SetImageColumn(int value){m_nColumn = value;}
    void        SetImageTotal(int value){
        m_nTotal = value;
    }

    void ParseFacePosition_(QXmlStreamReader &reader,QString &strFace,QString &strCamera,QString &strPosition);

public:
    bool WriteXML(QXmlStreamWriter &writer);
    bool ReadXML(QXmlStreamReader &reader);
};

#endif // DETECTIONWINDOWINFO_H
